package com.esyoga.yoyoga;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.web.socket.config.annotation.EnableWebSocket;
import org.springframework.web.socket.server.standard.ServerEndpointExporter;

@SpringBootApplication
@ComponentScan({"com.esyoga.yoyoga.handler","com.esyoga.yoyoga.service","com.esyoga.yoyoga.configuration","com.esyoga.yoyoga.pojo"})
@MapperScan("com.esyoga.yoyoga.mapper")    //扫mapper所在的包
@EnableWebSocket//开启websocket
public class YoyogaApplication  {

    public static void main(String[] args) {
        SpringApplication.run(YoyogaApplication.class, args);
    }

    //配置websocket依赖的对象
    @Bean
    public ServerEndpointExporter endpointExporter() {
        return new ServerEndpointExporter();
    }

}
